﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace safehomeSimulation
{
    public partial class frmConfigure : Form
    {
        private Room _room1;
        private Room _room2;
        private Room _room3;
        private Room _room4;

        public frmConfigure()
        {
            InitializeComponent();
        }

        public frmConfigure(ref Room room1,ref  Room room2, ref Room room3, ref Room room4 )
        {
            InitializeComponent();
            _room1 = room1;
            _room2 = room2;
            _room4 = room4;
            _room3 = room3;
        }


        private void frmConfigure_Load(object sender, EventArgs e)
        {

        }

        private void btnRoom1_Click(object sender, EventArgs e)
        {
            
            frmInstallSensor install = new frmInstallSensor(ref _room1);
            install.ShowDialog();
            if (install.DialogResult == DialogResult.OK)
            {
                frmRoomConfigure rcon = new frmRoomConfigure(ref _room1);
                rcon.ShowDialog();
            }

        }




        private void btnRoom2_Click(object sender, EventArgs e)
        {
            frmInstallSensor install = new frmInstallSensor(ref _room2);
            install.ShowDialog();

            frmRoomConfigure rcon = new frmRoomConfigure(ref _room2);
            rcon.ShowDialog();

        }

        private void btnRoom3_Click(object sender, EventArgs e)
        {
            frmInstallSensor install = new frmInstallSensor(ref _room3);
            install.ShowDialog();

            frmRoomConfigure rcon = new frmRoomConfigure(ref _room3);
            rcon.ShowDialog();

        }

        private void btnRoom4_Click(object sender, EventArgs e)
        {
            frmInstallSensor install = new frmInstallSensor(ref _room4);
            install.ShowDialog();

            frmRoomConfigure rcon = new frmRoomConfigure(ref _room4);
            rcon.ShowDialog();

        }
        private void btnOk_Click(object sender, EventArgs e)
        {
            this.Close();
        }

    }
}
